import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import HomePage from '../views/HomePage.vue'
import News from '../views/News.vue'
import BaskThings from '../views/BaskThings.vue'
import Trends from '../views/Trends.vue'
import SportsRecommendations from '../views/SportsRecommendations.vue'
import PersonalCenter from '../views/PersonalCenter.vue'
import SmallMi from '../components/News_SmallMi.vue'
import SelfHelp from '../components/News_SelfHelp.vue'
import Forum from '../components/Trend_forum.vue'
import SportExperience from '../components/Trend_sportExperience.vue'
import Shoppingcart from '../components/Shoppingcart.vue'
import Orders from '../components/Orders.vue'
import Display from '../components/Display.vue'
import Address from '../components/Address.vue'
Vue.use(VueRouter)

const routes = [{
		path: '/home',
		name: 'Home',
		component: Home
	},
	{
		path: '/about',
		name: 'About',
		// route level code-splitting
		// this generates a separate chunk (about.[hash].js) for this route
		// which is lazy-loaded when the route is visited.
		component: () => import( /* webpackChunkName: "about" */ '../views/About.vue')
	},
	{
		path: '/login',
		name: 'Login',
		component: Login
	},
	{
		path: '/register',
		name: 'Register',
		component: Register
	},
	{
		path: '/',
		name: 'HomePage',
		component: HomePage
	},
	{
		path: '/News',
		name: 'News',
		component: News,
		children: [{
				path: 'SmallMi',
				name: 'SmallMi',
				component: SmallMi
			},
			{
				path: 'SelfHelp', //以“/”开头的嵌套路径会被当作根路径，所以子路由上不用加“/”;在生成路由时，主路由上的path会被自动添加到子路由之前，所以子路由上的path不用在重新声明主路由上的path了。
				name: 'SelfHelp',
				component: SelfHelp
			}
		]
	},
	{
		path: '/BaskThings',
		name: 'BaskThings',
		component: BaskThings
	},
	{
		path: '/SportsRecommendations',
		name: 'SportsRecommendations',
		component: SportsRecommendations
	},
	{
		path: '/trends',
		name: 'Trends',
		component: Trends,
		children: [{
				path: 'Forum',
				name: 'Forum',
				component: Forum
			},
			{
				path: 'SportExperience', //以“/”开头的嵌套路径会被当作根路径，所以子路由上不用加“/”;在生成路由时，主路由上的path会被自动添加到子路由之前，所以子路由上的path不用在重新声明主路由上的path了。
				name: 'SportExperience',
				component: SportExperience
			}
		]

	},
	{
		path: '/personalcenter',
		name: 'PersonalCenter',
		component: PersonalCenter
	},
	{
		path: '/shoppingcart',
		name: 'Shoppingcart',
		component: Shoppingcart
	},
	{
		path: '/orders',
		name: 'Orders',
		component: Orders
	},
	{
		path: '/display',
		name: 'Display',
		component: Display
	},
	{
		path: '/address',
		name: 'Address',
		component: Address
	}
]

const router = new VueRouter({
	routes
})

export default router
